﻿using MugenInjection.Interface;

namespace MugenInjection.Syntax.Constant
{
    /// <summary>
    /// Specific fluent syntax for constant binding.
    /// </summary>
    public interface IConstantObjectSyntax : IBindingBuilder
    {
        /// <summary>
        /// Sets the value that indicates that binding will try to dispose the object on dispose binding.
        /// </summary>
        /// <returns>The fluent syntax.</returns>
        IConstantObjectSyntax TryDisposeObjects();

        /// <summary>
        /// Indicates that the binding should be registered with the specified name. Names are not
        /// necessarily unique; multiple bindings for a given service may be registered with the same name.
        /// </summary>
        /// <param name="name">The name to give the binding.</param>
        /// <returns>The fluent syntax.</returns>
        IConstantObjectSyntax NamedBinding(string name);

        /// <summary>
        /// Indicates that the binding should be registered with the specified key. Keys are not
        /// necessarily unique; multiple bindings for a given service may be registered with the same key.
        /// </summary>
        /// <param name="key">The key to give the binding.</param>
        /// <returns>The fluent syntax.</returns>
        IConstantObjectSyntax KeyedBinding(object key);

        /// <summary>
        /// Sets the specified setting for build binding.
        /// </summary>
        /// <param name="key">Setting name.</param>
        /// <param name="value">Setting value.</param>
        /// <returns>The fluent syntax.</returns>
        IConstantObjectSyntax WithSetting(string key, object value);
    }

    /// <summary>
    /// Specific fluent syntax for constant binding.
    /// </summary>
    /// <typeparam name="T">The service type.</typeparam>
    public interface IConstantObjectSyntax<T> : IBindingBuilder
    {
        /// <summary>
        /// Sets the value that indicates that binding will try to dispose the object on dispose binding.
        /// </summary>
        /// <returns>The fluent syntax.</returns>
        IConstantObjectSyntax<T> TryDisposeObjects();

        /// <summary>
        /// Indicates that the binding should be registered with the specified name. Names are not
        /// necessarily unique; multiple bindings for a given service may be registered with the same name.
        /// </summary>
        /// <param name="name">The name to give the binding.</param>
        /// <returns>The fluent syntax.</returns>
        IConstantObjectSyntax<T> NamedBinding(string name);

        /// <summary>
        /// Indicates that the binding should be registered with the specified key. Keys are not
        /// necessarily unique; multiple bindings for a given service may be registered with the same key.
        /// </summary>
        /// <param name="key">The key to give the binding.</param>
        /// <returns>The fluent syntax.</returns>
        IConstantObjectSyntax<T> KeyedBinding(object key);

        /// <summary>
        /// Sets the specified setting for build binding.
        /// </summary>
        /// <param name="key">Setting name.</param>
        /// <param name="value">Setting value.</param>
        /// <returns>The fluent syntax.</returns>
        IConstantObjectSyntax<T> WithSetting(string key, object value);
    }
}